import request from "@/request/request"
import requestMock from "@/request/requestMock"

// 01.封装获取三级分类列表的ajax请求
export const reqCategoryList = () => {
    return request.get("/product/getBaseCategoryList")
}

// 02.封装获取banner的mock请求
export const reqBannerList = () => {
    return requestMock.get("/banner/list")
}

// 03.封装获取banner的mock请求
export const reqFloorList = () => {
    return requestMock.get("/floor/list")
}

// 04.获取搜索商品列表
export const reqSearchGoodsList = (params) => {
    // console.log(params,"params");
    return request.post("/list", params)
}

// 05.获取商品详情信息
export const reqGoodsDetail = (skuId) => {
    return request.get(`/item/${ skuId }`)
}

// 06.添加购物车请求
export const reqAddToCart = (skuId, skuNum) => {
    return request.post(`/cart/addToCart/${ skuId }/${ skuNum }`)
}

// 07.购物车列表请求
export const reqCartList = () =>{
    return request.get(`/cart/cartList`)
}

// 08.修改购物车单个商品的选中状态
export const reqCheckCart = (skuID, isChecked) => {
    return request.get(`/cart/checkCart/${skuID}/${isChecked}`)
}